package com.edooteach.api.dto;

import java.beans.Transient;

import javax.persistence.FetchType;
import javax.persistence.ManyToOne;

import com.edoomath.entity.user.User;
import com.edoomath.entity.user.UserAddress;
/**
 * 
 * @author sjh
 *
 */
public class UserAddressRequest {
	
	@ManyToOne(optional = true, fetch = FetchType.LAZY)
    private User user;
    
    private String unionid;
    
    /**
     * 收货人
     */
    private String reciver;
    
    /**
     * 收货人手机
     */
    private String reciverMobile;
    
    private String province;
    
    private String city;
    
    private String district;
    
    /**
     * 详细地址
     */
    private String address;
    
    

    /**
     * The default constructor
     */
	public UserAddressRequest() {
	}
	
	/**
	 * 
	 * @param userAddressRequest
	 * @return
	 */
	@Transient
	public UserAddress generateUserAddress() {
		UserAddress userAddress = new UserAddress();
		userAddress.setUser(this.user);
		userAddress.setCity(this.city);
		userAddress.setUnionid(this.unionid);
		userAddress.setProvince(this.province);
		userAddress.setReciverMobile(this.reciverMobile);
		userAddress.setReciver(this.reciver);
		userAddress.setDistrict(this.district);
		userAddress.setAddress(this.address);
		return userAddress;
	}

	/**
	 * @return the user
	 */
	public User getUser() {
		return user;
	}

	/**
	 * @return the unionid
	 */
	public String getUnionid() {
		return unionid;
	}

	/**
	 * @return the reciver
	 */
	public String getReciver() {
		return reciver;
	}

	/**
	 * @return the reciverMobile
	 */
	public String getReciverMobile() {
		return reciverMobile;
	}

	/**
	 * @return the province
	 */
	public String getProvince() {
		return province;
	}

	/**
	 * @return the city
	 */
	public String getCity() {
		return city;
	}

	/**
	 * @return the district
	 */
	public String getDistrict() {
		return district;
	}

	/**
	 * @return the address
	 */
	public String getAddress() {
		return address;
	}

	/**
	 * @param user the user to set
	 */
	public void setUser(User user) {
		this.user = user;
	}

	/**
	 * @param unionid the unionid to set
	 */
	public void setUnionid(String unionid) {
		this.unionid = unionid;
	}

	/**
	 * @param reciver the reciver to set
	 */
	public void setReciver(String reciver) {
		this.reciver = reciver;
	}

	/**
	 * @param reciverMobile the reciverMobile to set
	 */
	public void setReciverMobile(String reciverMobile) {
		this.reciverMobile = reciverMobile;
	}

	/**
	 * @param province the province to set
	 */
	public void setProvince(String province) {
		this.province = province;
	}

	/**
	 * @param city the city to set
	 */
	public void setCity(String city) {
		this.city = city;
	}

	/**
	 * @param district the district to set
	 */
	public void setDistrict(String district) {
		this.district = district;
	}

	/**
	 * @param address the address to set
	 */
	public void setAddress(String address) {
		this.address = address;
	}

}
